<?php
/**
* WDC Like Dislike
* @author WDC <contact@web-designs-company.com>
* @link http://www.web-designs-company.com/
* @copyright (C) 2011 - 2012 JExtension
* @license GNU/GPL, see LICENSE.php for full license.
**/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

// get the controller name. If there is no controller name specified in the URL set to  the default, sendNewsletter
$controllerName = JRequest::getCmd( 'c', 'categories' );

// check if the controller name is something other than the default, if so, render the submenu appropriately
// note: the second argument in the addEntry helper function is weather or not the sub menu item is active

$controllerName = JRequest::getCmd( 'c', 'wdclikedislike' );

JSubMenuHelper::addEntry(JText::_('JEXT_WDCLIKEDISLIKE'), 'index.php?option=com_wdclikedislike', true);

require_once( JPATH_COMPONENT.DS.'controllers'.DS.$controllerName.'.php' );
$controllerName = 'wdclikedislikeController'.$controllerName;

// Create the controller
$controller = new $controllerName();

// Perform the Request task
$controller->execute( JRequest::getCmd('task') );

// Redirect if set by the controller
$controller->redirect();
?>